Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solution #1609

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open

solution #1609

wants to merge 20 commits into from

Conversation

DDD1721
Copy link

@DDD1721 DDD1721 commented Nov 3, 2024

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your hard work on this implementation! 😊 While your code meets many of the task requirements, there are a couple of critical issues that need to be addressed before we can approve the pull request.

  1. Division by Zero: In the calculate_washing_price method, there's a potential division by zero error when using self.distance_from_city_center as a divisor. Please ensure that this value is checked and handled appropriately to prevent runtime errors.

  2. Rating Calculation: The rate_service method updates total_rating before incrementing count_of_ratings, which leads to an incorrect average rating. Make sure to increment the count first to correctly factor in the new rating.

Once these issues are resolved, your code will be in great shape! Keep up the great work, and feel free to reach out if you have any questions or need further assistance. 🚀

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review button in the Reviewers tab.

app/main.py Outdated Show resolved Hide resolved
app/main.py Outdated

def rate_service(self, new_rating: float):
self.count_of_ratings += 1
total_rating = self.average_rating * (self.count_of_ratings - 1) + new_rating

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logical error: The total_rating calculation should occur after incrementing self.count_of_ratings. Otherwise, the new rating is not properly factored into the average.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-request review

@DDD1721 DDD1721 closed this Nov 5, 2024
@DDD1721 DDD1721 reopened this Nov 5, 2024
Copy link
Author

@DDD1721 DDD1721 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants